package Gather.CollectionsDome;

import java.util.ArrayList;
import java.util.Collections;

/**
 * ClassName:Collections002
 * Package:Gather.CollectionsDome
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/2/21-20:05
 * @Version:v1.0
 */
public class Collections002 {
    /* public static <T> boolean addAll(Collection<T> c, T...element)  批量添加元素
     * public static void shuffle(List<?> list) 打乱List集合元素的顺序*/
    public static void main(String[] args) {
        //创建集合
        ArrayList<String> list = new ArrayList<>();
        //批量添加元素
        Collections.addAll(list,"abc","def","qwer","asdf","1234");
        //打印集合
        System.out.println(list);
        //shuffle 打乱集合元素的顺序
        Collections.shuffle(list);
        System.out.println(list);
    }
}
